package com.dogkr.manager.web;


import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.ResultPath;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;

import com.dogkr.common.ServerAction;
import com.dogkr.server.entity.HostApply;
import com.dogkr.server.service.ManagerService;
import com.sean.common.page.Pagination;
import com.sean.common.page.ResultPagination;


// 设置Struts2注解
@ParentPackage(value = "login-manager")
@Namespace(value = "/manager")
@ResultPath("/WEB-INF/jsps")
// 页面文件空间
@Results({
	@Result(name = "apply", location = "apply.jsp")
})
public class ManagerAction extends ServerAction {
	private static final long serialVersionUID = 1L;
	
	@Autowired
	private ManagerService managerService;
	
	@Action(value = "apply")
	public String apply() {
		return "apply";
	}
	
	@Action(value = "apply_list")
	public void applyList() {
		Pagination pagination = this.getPaginationForParameter();
		ResultPagination<HostApply> res = managerService.selectApply(pagination);
		outJson(res);
	}
	@Action(value = "apply_verify")
	public void applyVerify() {
		managerService.verifyApply(id);
		outJson(res);
	}
}
